package com.elminster.dao.impl;

import java.util.List;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.stereotype.Component;

import com.elminster.dao.IUserDao;
import com.elminster.dao.common.impl.GenericDaoImpl;
import com.elminster.entity.base.User;

/**
 * A data access object (DAO) providing persistence and search support for User
 * entities. Transaction control of the save(), update() and delete() operations
 * can directly support Spring container-managed transactions or they can be
 * augmented to handle user-managed Spring transactions. Each of these methods
 * provides additional information for how to configure it for the desired type
 * of transaction control.
 * 
 * @see com.elminster.entity.base.User
 * @author MyEclipse Persistence Tools
 */

@Component
public class UserDaoImpl extends GenericDaoImpl<User, Integer> implements IUserDao {
    private static final Log log = LogFactory.getLog(UserDaoImpl.class);
    // property constants
    public static final String NAME = "name";
    
    public UserDaoImpl() {
        this(User.class);
    }

    public UserDaoImpl(Class<User> type) {
        super(type);
    }
    
    public List<User> findByName(Object name) {
        return findByProperty(NAME, name);
    }
}